package com.baosight.sczx.common.zm.cInterface.cm;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.spring.SpringApplicationContext;
import com.baosight.iplat4j.dao.Dao;

/**
 * <p>Title: Material.java（物资入库）</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 贾雪民
 * @version 1.0
 * <pre>Histroy:
 *          2011-6-30 6:31:30  贾雪民  Create
 *</pre>
 */
public class ImportMaterialDetail {
	private static Dao dao = (Dao)SpringApplicationContext.getBean("dao");
	
	/**
	 * 得到物资入库记录
	 * <p>Function: getDepotInfo</p>
	 * <p>Description: </p>
	 * <p>param IFUsing 使用状态</p>
	 * <p>return value:List<Map></p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-6-27 12:34:13 贾雪民 create
	 * </p>
	 *
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static EiInfo queryRecord(EiInfo inInfo) {
		Map<String, String> _map = new HashMap<String, String>();
		_map = (HashMap)inInfo.getBlock("result").getRows().get(0);
		String fdMaterialCode=_map.get("fdMaterialCode");

		_map.put("fdMaterialCode", fdMaterialCode);
		List _list  = dao.query("ZMCMImportmaterialDetail.queryrecord",_map );//查询物资入库记录

		if(_list.size()>0)
		{
			inInfo.setStatus(-1);
			inInfo.setMsg("该类物资已存在入库记录，不允许调整价格！");
		}
		return inInfo;
	}

}
